Do not accept empty definition of __XEN_INTERFACE_VERSION__
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 7 Apr 2006 08:57:36 +0000 (09:57 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 7 Apr 2006 08:57:36 +0000 (09:57 +0100)
in xen-compat.h. It leads to building a broken kernel image
where the kernel sources end up using an unexpected interface
version. In the case of Linux, the kernel expects to use
the new sched_op() hypercall but ends up calling the
legacy hypercall -- this breaks poll, reboot, and save/restore.

A more acceptable patch would be to detect the empty
definition in xen-compat.h and give a reasonable #error message
to fail the build: the current error message is confusing.

Signed-off-by: Keir Fraser <keir@xensource.com>
xen/include/public/xen-compat.h

index 4ef17bbaa8d1889ff12cfd80fc3de79a461ae5e1..c4f235095d08cadaec8edb61a6260532c2ff5ced 100644 (file)
 #if defined(__XEN__)
 /* Xen is built with matching headers and implements the latest interface. */
 #define __XEN_INTERFACE_VERSION__ __XEN_LATEST_INTERFACE_VERSION__
-#elif (__XEN_INTERFACE_VERSION__ - 0) == 0
+#elif !defined(__XEN_INTERFACE_VERSION__)
 /* Guests which do not specify a version get the legacy interface. */
-#ifdef __XEN_INTERFACE_VERSION__
-#undef __XEN_INTERFACE_VERSION__
-#endif
 #define __XEN_INTERFACE_VERSION__ 0x00000000
 #endif